/**
 */
package org.aphelie.chronicle.impl;

import java.lang.reflect.InvocationTargetException;
import org.aphelie.chronicle.ArcElement;
import org.aphelie.chronicle.ArcMessageProvider;
import org.aphelie.chronicle.ArcMessages;
import org.aphelie.chronicle.ArcSheet;
import org.aphelie.chronicle.ChroniclePackage;
import org.aphelie.chronicle.i18n.ChronicleMessageFormat;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Arc Sheet</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * </p>
 *
 * @generated
 */
public abstract class ArcSheetImpl extends ArcTopicImpl implements ArcSheet {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ArcSheetImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ChroniclePackage.Literals.ARC_SHEET;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated NOT
	 */
	public String getLabel(ArcElement element) {
		return getMessages().getMessage(element, ChronicleMessageFormat.LABEL);
	}
	
	protected abstract ArcMessages getMessages();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public int eDerivedOperationID(int baseOperationID, Class<?> baseClass) {
		if (baseClass == ArcMessageProvider.class) {
			switch (baseOperationID) {
				case ChroniclePackage.ARC_MESSAGE_PROVIDER___GET_LABEL__ARCELEMENT: return ChroniclePackage.ARC_SHEET___GET_LABEL__ARCELEMENT;
				default: return -1;
			}
		}
		return super.eDerivedOperationID(baseOperationID, baseClass);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
		switch (operationID) {
			case ChroniclePackage.ARC_SHEET___GET_LABEL__ARCELEMENT:
				return getLabel((ArcElement)arguments.get(0));
		}
		return super.eInvoke(operationID, arguments);
	}

} //ArcSheetImpl
